/**********************************************************************************************************************
*  COPYRIGHT
*  -------------------------------------------------------------------------------------------------------------------
*  Copyright (c) 2017 by Vector Informatik GmbH.                                                  All rights reserved.
*
*                This software is copyright protected and proprietary to Vector Informatik GmbH.
*                Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
*                All other rights remain with Vector Informatik GmbH.
*  -------------------------------------------------------------------------------------------------------------------
*  FILE DESCRIPTION
*  -------------------------------------------------------------------------------------------------------------------
*  File       :  DrvCrypto_CryWrapper.plugin
*  Module     :  Crypto
*  Description:  Entry point of Elisa Core for checking Configuration of DrvCrypto_CryWrapper.
*  -------------------------------------------------------------------------------------------------------------------
*  AUTHOR IDENTITY
*  -------------------------------------------------------------------------------------------------------------------
*  Name                          Initials      Company
*  -------------------------------------------------------------------------------------------------------------------
*  Philipp Ritter                visrpp        Vector Informatik GmbH
*  Tobias Finke                  vistof        Vector Informatik GmbH
*  -------------------------------------------------------------------------------------------------------------------
*  REVISION HISTORY
*  -------------------------------------------------------------------------------------------------------------------
*  Version    Date          Author   Change Id        Description
*  -------------------------------------------------------------------------------------------------------------------
*  02.01.00   2017-10-12    visrpp                    Initial creation
*  02.01.01   2017-10-26    vistof                    Added not supported service primitives
**********************************************************************************************************************/

/**********************************************************************************************************************
* Mandatory Functions
**********************************************************************************************************************/

/**********************************************************************************************************************
* Name         : RegisterPlugin
* Return value : Reference to a structure which contains the registration information about the plugin
* Description  : Elisa_core calls this function to query necessary information about the plugin.
*                This function is mandatory.
**********************************************************************************************************************/
def RegisterPlugin()
{
  var reg = ModulePluginRegistration()
  reg.SetVersion(0x020101)
  reg.SetPackageName("DrvCrypto_CryWrapper")
  reg.SetInputFiles(["Crypto_30_CryWrapper.c","Crypto_30_CryWrapper_Cfg.c"])
  return reg 
}

/**********************************************************************************************************************
* Name         : CheckVersions
* Return value : -
* Description  : Elisa_core calls this function to allow the plugin a version check against the BSW sources.
**********************************************************************************************************************/
def CheckVersions()
{
  /* No version check performed since only DEV_ERROR_DETECT define is checked */
}

/**********************************************************************************************************************
* Name         : main
* Parameter    : None
* Return value : None
* Description  : This is the entry point of the Elisa plugin. main calls all rule functions to check the configuration.
*                This function is mandatory.
* Requirements : ADAPT: Enter here the references to the corresponding requirements
**********************************************************************************************************************/
def main()
{
  InvokeRule("Check if QM is inactive", CheckQMDefines)
}

/**********************************************************************************************************************
* Rules
**********************************************************************************************************************/
/**********************************************************************************************************************
* Name         : CheckQMDefines
* Parameter    : None
* Return value : None
* Description  : This rule checks the settings of QM-related preprocessor defines.
* Requirements : N/A
**********************************************************************************************************************/
def CheckQMDefines()
{
  AssertDefineIsStdOn("CRYPTO_30_CRYWRAPPER_DEV_ERROR_DETECT")
  AssertDefineIsStdOff("CRYPTO_30_CRYWRAPPER_SERVICE_SIGNATURE_VERIFY") 
  AssertDefineIsStdOff("CRYPTO_30_CRYWRAPPER_SERVICE_SIGNATURE_GENERATE")
  AssertDefineIsStdOff("CRYPTO_30_CRYWRAPPER_SERVICE_AEADENCRYPT")       
  AssertDefineIsStdOff("CRYPTO_30_CRYWRAPPER_SERVICE_AEADDECRYPT")       
  AssertDefineIsStdOff("CRYPTO_30_CRYWRAPPER_SERVICE_HASH")              
}
